<template>
	<view class="top">

		<uni-card padding="0" spacing="0" style="border-radius: 10px;margin-top: 0px;">
			<template v-slot:cover>
				<view class="custom-cover">
					<image style="height: 200px;border-radius: 10px;margin: 10px 0;"
						src="../../../static/images/ly/优惠券.jpg"></image>
				</view>
			</template>
			<view style="padding: 12px;">
				哇噻!薅羊毛的看过来!易车修汽车维修服务中心出优惠团购了!纯手工洗车只要25元一次，还增20元油券，够意思了吧!哇噻!薅羊毛的看过来!易车惨汽车维修服务中心出优惠团购了!纯手工洗车只要25元一次，还增20元油，够意思了吧!
			</view>
		</uni-card>

		<uni-card style="border-radius: 10px;">
			<view><text
					style="color:#FF6532 ;font-size: 16px;margin-right: 10px;">价格：￥{{serviceDetails.newPrice}}</text><text><s>原价：￥{{serviceDetails.oldPrice}}</s></text>
			</view>
			<view>活动起止日期：{{yhqDetails.startTime}} 至 {{yhqDetails.endTime}}</view>
			<view>咨询电话：{{serviceDetails.shop.perPhone}}</view>
			<view>注意事项：{{serviceDetails.remark}}</view>
		</uni-card>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				serviceDetails: {},
				yhqDetails: {}
			}
		},
		onLoad(opt) {
			this.id = opt.id
			console.log(this.id)
			this.getServiceDetails();
			this.getcouponDetails();
		},
		methods: {
			getServiceDetails() {
				let that = this;
				this.$http({
					url: `/api/service/service/${that.id}`,
					method: 'GET',
					success(res) {
						that.serviceDetails = res.data.data
						console.log(that.serviceDetails)
					}
				})
			},
			getcouponDetails() {
				let that = this;
				this.$http({
					url: `/api/shanghuliebiao2/coupon/${that.id}`,
					method: 'GET',
					success(res) {
						that.yhqDetails = res.data.data
						// console.log(that.yhqDetails)
					}
				})
			},
		}
	}
</script>

<style>
	.top {
		height: 150px;
		background-image: url(../../../static/images/ly/组 6.png);

	}

	.custom-cover {
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>